<template>
  <div>
    <el-button @click="addEvent">增加</el-button>

    <div v-for="(item,index) in options" :key="index">{{ item.code }}</div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      options: [
        { code: 'A' },
        { code: 'B' },
        { code: 'C' }

      ]
    }
  },
  methods: {
    // A  在acsll  65
    addEvent() {
      this.options.push({
        // 静态 String.fromCharCode() 方法返回由指定的 UTF-16 代码单元序列创建的字符串
        // 65是A 为起始值  ASCII表
        code: String.fromCharCode(65 + this.options.length)

      })
      // console.log(this.options)
    }
  }
}
</script>

<style>

</style>
